import { ColumnsType } from "@/components";

/**
 * Table 字段对应 Label
 */
export enum TableLabel {
    Id = "ID",
    ShopCode = "店铺编码",
    Role = "角色",
    Username = "账号",
    Enable = "是否启用",
    Nickname = "昵称",
    RealName = "真实名称",
    PasswordSalt = "加密因子",
    Password = "密码",
    CreatedAt = "创建时间",
    UpdatedAt = "更新时间",
    Range = "创建时间",
}

/**
 * 占位符 Label
 */
export enum PlaceholderLabel {
    Id = "请输入" + TableLabel.Id,
    ShopCode = "请输入" + TableLabel.ShopCode,
    Role = "请选择" + TableLabel.Role,
    Username = "请输入" + TableLabel.Username,
    Nickname = "请输入" + TableLabel.Nickname,
    RealName = "请输入" + TableLabel.RealName,
    PasswordSalt = "请输入" + TableLabel.PasswordSalt,
    Password = "请输入" + TableLabel.Password,
}

export const columns: ColumnsType[] = [
    {
        minWidth: 100,
        label: TableLabel.Id,
        prop: "Id"
    },
    {
        minWidth: 120,
        label: TableLabel.ShopCode,
        prop: "ShopCode"
    },
    {
        minWidth: 120,
        label: TableLabel.Role,
        prop: "Role",
        Slots: {
            default: "Role"
        }
    },
    {
        minWidth: 120,
        label: TableLabel.Username,
        prop: "Username"
    },
    {
        width: 120,
        label: TableLabel.Enable,
        prop: "Enable",
        Slots: {
            default: "Enable"
        }
    },
    {
        minWidth: 120,
        label: TableLabel.Nickname,
        prop: "Nickname"
    },
    {
        minWidth: 120,
        label: TableLabel.RealName,
        prop: "RealName"
    },
    {
        minWidth: 120,
        label: TableLabel.PasswordSalt,
        prop: "PasswordSalt"
    },
    {
        minWidth: 150,
        label: TableLabel.Password,
        prop: "Password"
    },
    {
        width: 180,
        DateFormat: true,
        sortable: true,
        label: TableLabel.CreatedAt,
        prop: "CreatedAt"
    },
    {
        width: 180,
        DateFormat: true,
        sortable: true,
        label: TableLabel.UpdatedAt,
        prop: "UpdatedAt"
    },
    {
        fixed: "right",
        width: 100,
        label: "操作",
        prop: "",
        Slots: {
            default: "operate"
        }
    }
]